package com.bestcem.xm.survey.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bestcem.xm.component.mybatis.base.BaseEntity2;
import com.bestcem.xm.survey.config.StringValue2FastJsonSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;
import java.util.List;

/**
 * @TableName ds_survey_respondent
 */
@TableName(value = "ds_survey_respondent")
@Data
@EqualsAndHashCode(callSuper = true)
public class SurveyRespondent extends BaseEntity2 {
    /**
     *
     */
    @TableId(value = "id")
    private String id;

    /**
     * 问卷ID
     */
    @TableField(value = "project_id")
    @JSONField(name = "project_id")
    private String projectId;

    /**
     * 数据状态
     */
    @TableField(value = "data_status")
    @JSONField(name = "data_status")
    private Integer dataStatus;

    /**
     * 答卷状态
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 废弃前的状态，用于恢复
     */
    @TableField(value = "pre_discard_status")
    @JSONField(name = "pre_discard_status")
    private Integer preDiscardStatus;

    /**
     * 答卷序号
     */
    @TableField(value = "seq")
    private Long seq;

    /**
     * 是否转换
     */
    @TableField(value = "parsed")
    private Integer parsed;

    /**
     * 答卷版本
     */
    @TableField(value = "version")
    private Integer version;

    /**
     * 数据来源
     */
    @TableField(value = "source")
    private Integer source;

    /**
     * 答卷归属ID
     */
    @TableField(value = "group_id")
    @JSONField(name = "group_id")
    private String groupId;

    /**
     * 答卷归属编码
     */
    @TableField(value = "group_code")
    @JSONField(name = "group_code")
    private String groupCode;

    /**
     * 答题人ID
     */
    @TableField(value = "person_id")
    @JSONField(name = "person_id")
    private String personId;

    /**
     * HTTP user_agent头部信息
     */
    @TableField(value = "user_agent")
    @JSONField(name = "user_agent")
    private String userAgent;

    /**
     * 答题终端类型
     */
    @TableField(value = "client_type")
    @JSONField(name = "client_type")
    private Integer clientType;

    /**
     * 答题IP
     */
    @TableField(value = "ip")
    private String ip;

    /**
     * 开始答题时间
     */
    @TableField(value = "begin_time")
    @JSONField(name = "begin_time", format = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime beginTime;

    /**
     * 结束答题时间
     */
    @TableField(value = "finish_time")
    @JSONField(name = "finish_time", format = "yyyy/MM/dd HH:mm:ss")
    private LocalDateTime finishTime;

    /**
     * rspd_data_id
     */
    @TableField(value = "rspd_data_id")
    @JSONField(name = "rspd_data_id")
    private String rspdDataId;

    /**
     * rspd_weixin_id
     */
    @TableField(value = "rspd_weixin_id")
    @JSONField(name = "rspd_weixin_id")
    private String rspdWeixinId;

    /**
     * rspd_location_id
     */
    @TableField(value = "rspd_location_id")
    @JSONField(name = "rspd_location_id")
    private String rspdLocationId;

    /**
     * rspd_extra_id
     */
    @TableField(value = "rspd_extra_id")
    @JSONField(name = "rspd_extra_id")
    private String rspdExtraId;

    /**
     * rspd_attachment_id
     */
    @TableField(value = "rspd_attachment_id")
    @JSONField(name = "rspd_attachment_id")
    private String rspdAttachmentId;

    /**
     * 外部系统的seq
     */
    @TableField(value = "ext_seq")
    @JSONField(name = "ext_seq")
    private String extSeq;

    /**
     * 提交序列
     */
    @TableField(value = "submit_seq")
    @JSONField(name = "submit_seq")
    private Long submitSeq;

    /**
     * ip城市
     */
    @TableField(value = "ip_country")
    @JSONField(name = "ip_country")
    private String ipCountry;

    /**
     * ip省份
     */
    @TableField(value = "ip_province")
    @JSONField(name = "ip_province")
    private String ipProvince;

    /**
     * ip城市
     */
    @TableField(value = "ip_city")
    @JSONField(name = "ip_city")
    private String ipCity;

    /**
     * 备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 联系人id
     */
    @TableField(value = "member_id")
    @JSONField(name = "member_id")
    private String memberId;

    /**
     * 当前语言
     */
    @TableField(value = "current_lang")
    @JSONField(name = "current_lang")
    private String currentLang;

    /**
     * 投放id
     */
    @TableField(value = "deliver_id")
    @JSONField(name = "deliver_id")
    private String deliverId;

    /**
     * 投放组id
     */
    @TableField(value = "deliver_group_id")
    @JSONField(name = "deliver_group_id")
    private String deliverGroupId;

    /**
     * 投放记录id
     */
    @TableField(value = "dlvr_rid")
    @JSONField(name = "dlvr_rid")
    private String dlvrRid;

    /**
     * 二次投放记录id
     */
    @TableField(value = "again_deliver_record_id")
    @JSONField(name = "again_deliver_record_id")
    private String againDeliverRecordId;

    /**
     * 预生成csv状态标记
     */
    @TableField(value = "excel_parsed")
    @JSONField(name = "excel_parsed")
    private Integer excelParsed;

    /**
     * survey_gids
     */
    @TableField(value = "survey_gids")
    @JSONField(serializeUsing = StringValue2FastJsonSerializer.class, name = "survey_gids")
    private String surveyGids;

    /**
     * 专用链接投放专用码
     */
    @TableField(value = "ded_code")
    @JSONField(name = "ded_code")
    private String dedCode;

    /**
     * 样本投放surveyunion拼接上的参数
     */
    @TableField(value = "idy_sid")
    @JSONField(name = "idy_sid")
    private String idySid;

    /**
     * 是否从sample拷贝
     */
    @TableField(value = "is_copy_demo")
    private Boolean isCopyDemo;

    /**
     * 总分
     */
    @TableField(value = "score")
    private Double score;

    //get_respondent_mq_data 里面设置了，也不知道有没有用，先加上
    @TableField(exist = false)
    @JSONField(name = "wx_info")
    private SurveyRespondentWeixin wxInfo;

    //create_respondent_v2里面设置了,且是数组，也不知道有没有用，先加上
    @TableField(exist = false)
    @JSONField(name = "wx_infos")
    private List<SurveyRespondentWeixin> wxInfos;

    @TableField(exist = false)
    @JSONField(name = "quota_checkitem_list")
    private String quotaCheckitemList;

    /**
     * 用于查询统计
     */
    @TableField(exist = false)
    private Integer count;
}